home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1997 February
/
EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso
/
enigma
/
earcd
/
business
/
autorexx.lha
/
Rexx
/
XportSumm.rexx
< prev
Wrap
OS/2 REXX Batch file
|
1996-12-10
|
2KB
|
91 lines
/*
XportSumm.rexx - Collects, collates and writes summary data.
(c) 1996 Karl Mottram - Bifrost Industries
Started 0045 hrs - 06-12-96
Last Updated $VER: v1.1_(10-12-96) - Added running total calc...
*/
Init:
Signal On BREAK_C /* Break Trapping */
SpyFile = "LOGS:BioWare.log" /* For Expansion */
SummFile = "BIZ:Accounts/Fiscal/Overall.fsc" /* Summary output file */
VarFile = "AutoRexx/JobBase.env" /* ENV: and ENVARC: */
Address(TFJOB.1)
Options Results
CheckStatus:
GETFIELD Summ
If RESULT = 0 then signal Exzit
Collect:
GETFIELD JNum
InNum = RESULT
GETFIELD Amount
Income = RESULT
GETFIELD Costs
Purchs = RESULT
FormatDate: /*YYYYmmDD*/
TDay = Right(Date(s),2) /* ::||*/
TMon = Left(Right(Date(s),4),2) /* || */
ToDate = TDay||'-'||TMon
SavDat = Left(ToDate,9)
FormatRaw:
If Income = '' | Income = 'FREE' then do
SavInc = Left('-',7)
SavTot = " -.--"
Signal FormatNext
end
else do
SavInc = Right(Income,7)
Call GetEnvs
NewTotal = RunTotal + Income
Call SaveEnvs
SavTot = Right(NewTotal,7)
end
FormatNext:
Blurk1 = " "
Blurk2 = " || - "
If Purchs = '' then SavCst = Left('-',7)
else SavCst = Right(Purchs,7)
Blurk3 = " - - "
Collate:
SummLine = SavDat||SavInc||Blurk1||SavTot||Blurk2||SavCst||Blurk3||InNum
SaveSumm:
Open(Summ,SummFile,A)
Writeln(Summ,SummLine)
Close(Summ)
Exzit:
Exit
GetEnvs:
Open(Envs,'ENV:'VarFile,R)
RunTotal = Readln(Envs)
Close(Envs)
Return
SaveEnvs:
Open(Envs,'ENV:'VarFile,W)
Writeln(Envs,NewTotal)
Close(Envs)
Address Command 'c:Copy ENV:'VarFile 'to ENVARC:'VarFile
Return
/* Output format data...
10 7 2 7 14 7 20 4
! ! ! ! ! ! !
1234578901234567121234567123456789012341234567123456789012345678901234
-----------------------------------------------------------------------
Date: Income: Total: || Phone Purchs Equip Sundry NOTE
-----------------------------------------------------------------------
05-04 - - || 150.00 - - -Cel
24-04 95.00 95.00 || - - - - 2021
03-05 85.00 180.00 || - - - - 2022
*/